//
//  ViewController.m
//  SMSCodeFramework
//
//  Created by timmy on 16/10/25.
//  Copyright © 2016年 timmy. All rights reserved.
//

#import "ViewController.h"
#import "RYTRSAEncryptor.h"
#import "RYTMD5Encryptor.h"

@interface ViewController ()<UITextFieldDelegate>

@property(nonatomic,strong)UITextField *textf;
@property(nonatomic,strong)UITextField *codef;
@property(nonatomic,strong)NSString *AESKey;
@property(nonatomic,strong)NSString *pubKey;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    NSString *originStr = @"我爱你";
    [RYTRSAEncryptor keyWith:^(NSString *pubKey, NSString *priKey) {
        NSString *encryptStr = [RYTRSAEncryptor encryptString:originStr publicKey:pubKey];
        NSLog(@"公钥加密1：%@",encryptStr);
        NSString *dencryptstr = [RYTRSAEncryptor decryptString:encryptStr privateKey:priKey];
        NSLog(@"私钥解密：%@",dencryptstr);
    }];

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
